﻿using System;
using FamilyBook.Core.Entities;
using FamilyBook.Core.Repositories;

namespace FamilyBook.Repository.EF.Tests
{
    public static class EfTestHelper
    {
        public static Person CreatePerson(IGeneralRepository<Person, int> cpRep)
        {
            var peron = new Person()
                            {
                                FirstName = "FN_" + Guid.NewGuid().ToString(),
                                LastName = "LN_" + Guid.NewGuid().ToString()
                            };
            return cpRep.Create(peron);
        }

        public static Organization CreateOrganization(IGeneralRepository<Organization, int> cpRep)
        {
            var org = new Organization()
                        {
                            Name = "Org_" + Guid.NewGuid().ToString(),
                        };
            org.Description = "Desc_" + org.Name;

            return cpRep.Create(org);
        }
    }
}
